<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link rel="stylesheet" type="text/css" href="__ADMIN__/Huploadify/Huploadify.css"/>
<script src="__ADMIN__/js/jquery.min.js"></script>
<script type="text/javascript" src="__ADMIN__/Huploadify/jquery.Huploadify.js"></script>
<style type="text/css">
</style>
<script type="text/javascript">
$(function(){
    $('#upload').Huploadify({
        auto:true,
        fileTypeExts:'*.jpg;*.png',
        multi:true,
        formData:{key:{$aid},key2:'vvvv'},
        fileSizeLimit:9999,
        showUploadedPercent:true,//是否实时显示上传的百分比，如20%
        showUploadedSize:true,
        removeTimeout:9999999,
        uploader:'{:U('picture/upload',['aid'=>$aid])}',
        onUploadStart:function(){
            //alert('开始上传');
            },
        onInit:function(){
            //alert('初始化');
            },
        onUploadComplete:function(file,data){
            data = JSON.parse(data);
            var d=new Date()
            l = '<li><a href="#" onclick="showPicture()">';
            l += '<img class="am-img-thumbnail am-img-bdrs img" src="'+data.path+'" alt="'+data.pname+'"/></a>';
            l += '<div class="gallery-title">'+data.pname+'</div>';
            l += '<div class="gallery-desc">'+d.getFullYear()+'-'+d.getMonth() + 1+'-'+d.getDate()+'-'+' <a href="#" onclick="layer.alert('+data.path+')">外链</a> <a href="#" onclick="setUpdate('+data.pid+')">修改</a> <a href="#" onclick="onDelete('+data.pid+')">删除</a></div></li>'
            parent.$('#picture').prepend(l);
            parent.$("#kong").remove();
        },
        onDelete:function(file){
            console.log('删除的文件：'+file);
            console.log(file);
        }
        });
    });
</script>
</head>

<body>
<div id="upload"></div>
</body>
</html>
